package com.moto.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.moto.entity.MotoStartPic;
import com.moto.repository.MotoStartPicRepository;
import com.moto.service.AppConfigService;

@Service("appConfigService")
public class AppConfigServiceImpl implements AppConfigService {
	private static final Logger LOG = LoggerFactory.getLogger(AppConfigServiceImpl.class);
	
	
	@Autowired
	private MotoStartPicRepository motoStartPicRepository;

	@Override
	public List<MotoStartPic> getStartPicList() {
		LOG.debug("App启动图片查询");
		return motoStartPicRepository.getAll();
	}

	@Override
	public boolean deleteStartPic(String picId) {
		LOG.debug("删除App启动图片");
		int sum = motoStartPicRepository.deleteStartPic(picId);
		if(sum==1){
			return true;
		}else{
			return false;
		}
	}

	@Override
	public int saveStartPic(MotoStartPic motoStartPic) {
		LOG.debug("保存启动图片");
		return motoStartPicRepository.saveStartPic(motoStartPic);
	}
}
